Skip to content

fix: make npm run release work from the frontend subdir#6

Merged
DeaglePC merged 1 commit into
mainfrom
fix/release-flow
Jun 9, 2026
Merged

fix: make npm run release work from the frontend subdir#6
DeaglePC merged 1 commit into
mainfrom
fix/release-flow

Conversation

@DeaglePC

@DeaglePC DeaglePC commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Problem

npm run release (added in #5) didn't actually cut a release. When npm version runs from frontend/ — which is a subdirectory of the git repo, not the git root — it decides it is "not a git repository" and silently skips creating the release commit and tag, while still running the version/postversion lifecycle scripts. The net effect:

  • version files got bumped but left uncommitted,
  • postversion's git push fired prematurely (pushing the wrong commit),
  • no vX.Y.Z tag was created, so CI never built a Release.

Fix

Drive git explicitly from a script instead of relying on npm version's built-in git step.

  • Add scripts/release.mjs:
    1. Require a clean working tree (fails loudly instead of half-releasing).
    2. Bump package.json + package-lock.json via npm version <type> --no-git-tag-version.
    3. Sync manifest.json.
    4. Warn if changelog.json has no entry for the new version.
    5. git commit → annotated git taggit push --follow-tags.
  • Repoint release[:patch|minor|major] at the script; drop the version and postversion lifecycle hooks.
  • Remove the now-unused sync-manifest-version.mjs.

Result

npm run release now reliably commits the bump, tags vX.Y.Z, and pushes — triggering CI to build the zip and create the GitHub Release. Verified the clean-tree guard aborts safely on a dirty tree.

Note: the v1.0.2 release commit + tag are landing on main separately (out of band) using the old manual recovery; this PR only contains the flow fix and does not touch the version number.

🤖 Generated with Claude Code

npm version skips its git commit/tag step when run from frontend/ (the
package dir is not the git root), so the previous flow bumped files and
ran the version/postversion hooks but never created the release commit or
tag, and pushed prematurely. Drive git explicitly instead.

- Add scripts/release.mjs: require a clean tree, bump via `npm version
  --no-git-tag-version`, sync manifest.json, warn on missing changelog
  entry, then commit + annotated tag + push --follow-tags.
- Point release[:patch|minor|major] at the script; drop the version and
  postversion lifecycle hooks.
- Remove the now-unused sync-manifest-version.mjs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DeaglePC
DeaglePC merged commit 621e0b4 into main Jun 9, 2026
2 checks passed
@DeaglePC
DeaglePC deleted the fix/release-flow branch June 10, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant